//
//  NetRequestTool.h
//  TechGoldology
//
//  Created by 陈名邦 on 2018/9/29.
//  Copyright © 2018年 陈名邦. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <AFNetworking.h>
#import <JSONKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface NetRequestTool : NSObject

//GET--AFN+JSON
+ (void)get:(NSString *)url
     params:(NSDictionary *)params
    success:(void (^)(id json))success
    failure:(void (^)(NSError *error))failure;

//POST--AFN+JSON
+ (void)post:(NSString *)url
      params:(NSDictionary *)params
     success:(void (^)(id json))success
     failure:(void (^)(NSError *error))failure;

+ (void)spePost:(NSString *)url
      params:(NSDictionary *)params
     success:(void (^)(id json))success
     failure:(void (^)(NSError *error))failure;

//GET--NETWORK
+ (BOOL)getNetwork;

//POST-UPDATE--FILE(MimeType)
+ (void)post:(NSString *)url
      params:(NSDictionary *)params
        data:(void (^)(id <AFMultipartFormData> formData))block
     success:(void (^)(id json))success
     failure:(void (^)(NSError *error))failure;

+ (void)spePost:(NSString *)url
      params:(NSDictionary *)params
        data:(NSMutableDictionary *)datas
     success:(void (^)(id))success
     failure:(void (^)(NSError *))failure;



@end

NS_ASSUME_NONNULL_END
